{extend name="layout/base" /}
{block name="main"}
<article class="main__content content">
    <h4>订单列表</h4>
    <table class="table">
        <thead class="table__head">
        <tr>
            <th>ID</th>
            <th>订单编号</th>
            <th>用户名</th>
            <th>客房名称</th>
            <th>房间号</th>
            <th>入住日期</th>
            <th>离店日期</th>
            <th>总价</th>
            <th>预定时间</th>
            <th>状态</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody class="table__body">
        {foreach $orderList as $order}
        <tr>
            <td>{$order.id}</td>
            <td>{$order.order_no}</td>
            <td>{$order.username}</td>
            <td>{$order.room_name}</td>
            <td>{$order.room_number}</td>
            <td>{$order.start_date}</td>
            <td>{$order.end_date}</td>
            <td>{$order.total}</td>
            <td>{$order.create_time}</td>
            <td>{$order.status_str}</td>
            <td>
                {if $order.status == 1}
                <div class="tpl-table-black-operation">
                    <a href="{:url('edit')}?id={$order.id}"
                       class="tpl-table-black-operation-del">
                        <i class="am-icon-trash"></i> 办理入住
                    </a>
                </div>
                {/if}
                {if $order.status == 4}
                <div class="tpl-table-black-operation">
                    <a href="{:url('edit')}?id={$order.id}"
                       class="tpl-table-black-operation-del">
                        <i class="am-icon-trash"></i> 退房
                    </a>
                </div>
                {/if}
                <div class="tpl-table-black-operation">
                    <a href="{:url('delete')}?id={$order.id}"
                       class="tpl-table-black-operation-del">
                        <i class="am-icon-trash"></i> 删除
                    </a>
                </div>
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
</article>
{/block}
